# -*- coding: utf-8 -*-
import sys

from PySide.QtCore import QTranslator
from PySide.QtGui import QApplication

from gui.FileEditor import MainWindow
from language import languang_rc


def main():
    args = sys.argv
    app = QApplication(args)
    main_trans = QTranslator()
    main_trans.load(":/language/main.qm")
    lib_trans = QTranslator()
    lib_trans.load(":/language/qt.qm")
    app.installTranslator(main_trans)
    app.installTranslator(lib_trans)
    window = MainWindow(args)
    window.show()
    languang_rc.qCleanupResources()
    app.exec_()
    sys.exit(0)


if __name__ == "__main__":
    try:
        main()
    except Exception:
        pass
